package org.csu.forum.domain.VO;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import org.csu.forum.domain.PO.Files;
import org.csu.forum.domain.PO.Followpost;
import org.csu.forum.domain.PO.Post;
import org.springframework.stereotype.Component;

import java.io.Serializable;

@Data
@Component

public class PostEditVO implements Serializable {

    @JsonIgnore
    private Post post;

    @JsonIgnore
    private Followpost followpost;

    @JsonIgnore
    private Files files;

    private int postid;

    private String content;

    private int fileid;

    private int zoneid;

    private int sectionid;

    @JsonIgnore
    private int fileId;

    private String fileDescription;

    private String filesrc;

    private int titlepostId;

    private int followpostId;

    private int followpostFloor;

    public PostEditVO(){
        this.post = new Post();
        this.followpost = new Followpost();
        this.files = new Files();
    }

    public Post getPost(){return post;}

    public void setPost(Post post){this.post = post;}

    public Files getFiles(){return files;}

    public void setFiles(Files files){this.files = files;}

    public Followpost getFollowpost(){return followpost;}

    public void setFollowpost(Followpost followpost){this.followpost = followpost;}

    public void setParameter(){

        this.content = this.post.getContent();
        this.fileid = this.post.getFileid();
        this.zoneid = this.post.getZoneid();
        this.postid = this.post.getPostid();
        this.fileId = this.post.getFileid();
        this.fileDescription = this.files.getFileDescription();
        this.filesrc = this.files.getFilesrc();
        this.titlepostId = this.followpost.getTitlepostId();
        this.followpostId = this.followpost.getFollowpostId();
        this.followpostFloor = this.followpost.getFollowpostFloor();
        this.sectionid = this.post.getSectionid();

    }

    public void setParameter1(){

        this.post.setPostid(this.postid);
        this.post.setContent(this.content);
        this.post.setZoneid(this.zoneid);
        this.post.setFileid(this.fileid);
        this.post.setSectionid(this.sectionid);
        this.files.setFileDescription(this.fileDescription);
        this.files.setFileId(this.fileId);
        this.files.setFilesrc(this.filesrc);
        this.followpost.setTitlepostId(this.titlepostId);
        this.followpost.setFollowpostFloor(this.followpostFloor);
        this.followpost.setFollowpostId(this.followpostId);

    }


}
